<link href="<?php echo DOMAIN; ?>/css/my-style.css" rel="stylesheet" type="text/css" />
<?php $data= $this->data; $all_institutes= $this->all_institutes; 

?>

<?php 
	if($this->success){
	?>
		<div class="notification success" >
			<span class="strong">Thao tác thành công.</span>
			<span class="close" title="Dismiss"></span>
		</div>
		<?php
	}
	
	if($this->warning){
		?>
			<div class="notification warning" >
				<span class="strong">Dữ liệu bạn nhập còn thiếu. Xin vui lòng kiểm tra lại!</span>
				<span class="close" title="Dismiss"></span>
			</div>
			<?php
		}
?>

<form method="post" class="form" action="<?php echo DOMAIN_INDEX.'/admin/teacher/add'?>" enctype="multipart/form-data">
      <fieldset>
        <legend>Thêm thông tin giáo viên</legend>
     
        <p class='row-form'>
          <label class='title-row' for="City">Họ tên <span class="required">*</span>:</label>
          <input style="width:250px;"  type="text" name="name" value="<?php echo $data['name']; ?>"  />
        </p>
        <p class='row-form'>
          <label class='title-row' for="City">Ngày sinh <span class="required">*</span>:</label>
          <input style="width:250px;"  type="text" name="birthday" value="<?php echo $data['birthday'] ?>" />
        </p>
        <p class='row-form'>
          <label class='title-row' for="City">Khoa/Viện <span class="required">*</span>:</label>
          <select name="institutes">
                <?php  
                    
                    foreach($all_institutes as $item){ ?>
                    <option value="<?php echo $item['id'] ?>"><?php echo $item['name']; ?></option>    
                        
                <?php } ?>
          </select>
          
         <!-- 
          <input style="width:250px;"  type="text" name="institutes" value="<?php echo $data['id_institutes'] ?>" />
        -->
        </p>
        <p class='row-form'>
          <label class='title-row' for="City">Email <span class="required">*</span>:</label>
          <input style="width:250px;"  type="text" name="email" value="<?php echo $data['email'] ?>" />
        </p>
        <p class='row-form'>
          <label class='title-row' for="City">Phone <span class="required">*</span>:</label>
          <input style="width:250px;"  type="text" name="phone" value="<?php echo $data['phone'] ?>" />
        </p>
        <p class='row-form'>
          <label class='title-row' for="City">Tên tài khoản <span class="required">*</span>:</label>
          <input style="width:250px;"  type="text" name="username" value='<?php echo $data['username'] ?>' />
        </p>
        <p class='row-form'>
          <label class='title-row' for="City">Mật khẩu <span class="required">*</span>:</label>
          <input style="width:250px;"  type="text" name="password" value="<?php echo base64_decode($data['password']) ?>" />
        </p>
        <p class='row-form'>
          <label class='title-row' for="City">Trạng thái <span class="required">*</span>:</label>
          <select name="status">
            <option value="1" >ON</option>
            <option value="0" >OFF</option>
          </select>
        </p>
      
        <p class='row-form'>
        	<input class="blue" style="margin-bottom:-10px;" type="submit" name="submit" value="Thêm"/>
            <input class='blue' style="margin-bottom:-10px;"  onclick="javascript:window.location='<?php echo DOMAIN_INDEX ?>/admin/teacher'; return false;" value="Hủy bỏ" type="button"/>
        </p>
      </fieldset>
</form>
